import { createStore } from "vuex";

interface State {
  recruitScrollY: number;
}
/*使用export default才可以将store*/
export default createStore({
  state: {
    backedPath: "192.168.31.97:8081", //后端地址

    recruitScrollY: 0, // 存储的滚动值
    showpopupbasic: true, //第一次打开弹出内容
    storePostList: [], //存储贴子列表
    storePageNumber: 0, //存储页码
    storeActionName: "全部", //存储动作名称

    SearchScrollY: 0, //存储搜索滚动值
    SearchShowAction: false, //存储搜索动作名称
    SearchPostList: [], //存储搜索列表
    SearchPageNumber: 1, //存储搜索页码

    isSendSMS: false, //是否发送短信验证码
    SendSMSTime: 0, //发送短信时间

    anonImg: "/anonimgs/anon7.png",
  },
  getters: {
    recruitScrollY: (state) => state.recruitScrollY,
  },
  mutations: {
    changeRecruitScrollY: (state, recruitScrollY) => {
      state.recruitScrollY = recruitScrollY;
      // console.log(state.recruitScrollY);
    },
    changeShowpopupbasic: (state) => {
      state.showpopupbasic = !state.showpopupbasic;
    },
  },
  actions: {},
  modules: {},
});
